import request from '@/utils/request'

export function roleAdd(url, obj) {
  return request({
    url: '/role/' + url,
    method: 'post',
    data: obj
  })
}
// 查询角色
export function roleSearch(pageSize, pageNo) {
  return request({
    // url: '/role/findAll',
    url: '/role/selectAll',
    method: 'post',
    data: {
      pageSize,
      pageNo
    }
  })
}
export function roleSearchPage(pageSize, pageNo) {
  return request({
    url: '/role/select',
    method: 'post',
    data: {
      pageSize,
      pageNo
    }
  })
}
export function roleById(obj) {
  return request({
    url: '/role/get',
    method: 'post',
    data: obj
  })
}
export function roleDel(obj) {
  return request({
    url: '/role/delete',
    method: 'post',
    data: obj
  })
}

export function treeQuery(obj) {
  return request({
    url: '/permission/selectAuthorizedPermission',
    // url: '/permission/findAllPermission',
    method: 'post',
    data: obj
  })
}

export function accrQuery() {
  return request({
    // url: '/urolepermission/queryByRole/' + id,
    url: '/permission/findUserMenu',
    method: 'get'
  })
}

export function accrSave(obj) {
  return request({
    // url: '/urolepermission/addrelated',
    url: '/permission/editAuthPermission',
    method: 'post',
    data: obj
  })
}

export function getRoles() { }
export function updateRole() { }
export function addRole() { }
export function removeRole() { }
export function getRoleUsers() { }
export function addRoleUsers() { }
// export function getRoles(){}
// export function getRoles(){}
// export function getRoles(){}
